package com.sims.action.material;

import org.springframework.beans.factory.annotation.Autowired;

import com.sims.bean.Material;
import com.sims.service.MaterialService;
import com.sims.util.ActionEnhanced;
import com.sims.util.Constant;

public class AddMaterialAction extends ActionEnhanced{
	private Material material;
	@Autowired
	private MaterialService materialService;
	public Material getMaterial() {
		return material;
	}
	public void setMaterial(Material material) {
		this.material = material;
	}
	
	@Override
	public String execute() {
		
		result = materialService.addMaterial(material);
		if (result.containsKey(Constant.SUCCESS)) {
			System.out.println("success");
			return SUCCESS;
		}
		return ERROR;
	}
}
